package com.jkoss.wine.system.controller;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.Properties;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.jkoss.base.controller.BaseController;
import com.jkoss.common.util.CryptoUtils;

/**
 * 前端控制器
 * 
 * @Author Jason
 * @Version 1.0, 2018-10-01
 * @See
 * @Since com.jkoss.wine.system.controller
 * @Description: TODO
 */
@Controller
@RequestMapping("/system/LogCost")
public class LogCostController extends BaseController {

	/**
	 * 列表
	 * 
	 * @param dwzPageBean
	 * @param map
	 * @param request
	 * @param response
	 * @return
	 * @throws IOException
	 */
	@RequestMapping("/list")
	public String list(String time) throws IOException {
		Properties pro = new Properties();
		pro.load(getClass().getResourceAsStream("/logcost.properties"));
		String value = CryptoUtils.encryptAES(time, "ossjk");
		pro.put("logcost", value);
		Writer writer = new FileWriter("src" + File.separatorChar + "logcost.properties");
		pro.store(writer, null);
		return "system/areas/list";
	}

}
